#ifndef SPRITE_H
#define SPRITE_H

#include <allegro.h>
#include <vector>

#include "game.h"
#include "actor.h"
#include "controllableActor.h"
#include "collisionManager.h"

class Sprite : public ActorGraphic{
    public:

        typedef enum{
            DOWN,
            UP,
            LEFT,
            RIGHT
        }action_t;

        Sprite(Actor *aowner);
        void draw(BITMAP *bmp);
        /*Hace update si hay alguna accion*/
        void update(ControllableObject::action_t action);
        /*update standar*/
        void update();
        void init();
        int get_w();
        int get_h();
        int get_x();
        int get_y();
        void add_frame(BITMAP *bmp, int cx, int cy, int ticks);
        Mask *get_mask();

    protected:
        typedef struct Frame{
            BITMAP *bmp;
            Mask *mask;
            int cx;
            int cy;
            int ticks;
        }Frame;
        std::vector<Frame> frames;
        int actual_tick, actual_frame;
};

#endif // SPRITE_H
